<?php

require("includes/basic.php");

$vid=$_POST['vid'];
$uname=$_POST['uname'];
$password=md5($_POST['password']);
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$mob=$_POST['mob'];
$vendor_id=$_POST['vid'];
$creator=$_SESSION['uid'];
//echo $vendor_id;
$s=mysql_query("select * from vendor_master where vendor_id=$vendor_id");
$row=mysql_fetch_array($s);
extract($row);
$cust_id=$row['vendor_created_by'];
//echo $cust_id;
$sql=mysql_query("insert into user_master(`vendor_id`,`first_name`,`last_name`,`mobile`,`user_name`,`user_password`,`customer_id`,`user_created_on`,`user_created_by`) values ('$vendor_id','$fname','$lname','$mob','$uname','$password','$cust_id',sysdate(),'$creator')");



if($sql)
{
	header("location:viewvendor-contact.php?vendorCid=$vendor_id");
}
else {
	
	echo "no";
	
	}

?>